package com.zutassociation.system.service.impl;

import com.zutassociation.system.domain.Sponsor;
import com.zutassociation.system.mapper.SponsorMapper;
import com.zutassociation.system.service.SponsorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 赞助 服务层实现
 *
 * @author 黄玉东
 * @version 1.0
 * @date 2021/2/25 17:51
 */
@Service
public class SponsorServiceImpl implements SponsorService {

    @Autowired
    private SponsorMapper sponsorMapper;

    /**
     * 查询赞助信息
     *
     * @param sponsorId 赞助ID
     * @return 赞助信息
     */
    @Override
    public Sponsor selectSponsorById(Long sponsorId) {
        return sponsorMapper.selectSponsorById(sponsorId);
    }

    /**
     * 查询上一条赞助列表
     *
     * @param sponsorId 赞助信息
     * @return 赞助集合
     */
    @Override
    public Sponsor selectUpSponsor(Long sponsorId) {
        return sponsorMapper.selectUpSponsor(sponsorId);
    }

    /**
     * 查询下一条赞助列表
     *
     * @param sponsorId 赞助信息
     * @return 赞助集合
     */
    @Override
    public Sponsor selectNextSponsor(Long sponsorId) {
        return sponsorMapper.selectNextSponsor(sponsorId);
    }

    /**
     * 查询赞助列表
     *
     * @param sponsor 赞助信息
     * @return 赞助集合
     */
    @Override
    public List<Sponsor> selectSponsorList(Sponsor sponsor) {
        return sponsorMapper.selectSponsorList(sponsor);
    }

    /**
     * 新增赞助
     *
     * @param sponsor 赞助信息
     * @return 结果
     */
    @Override
    public int insertSponsor(Sponsor sponsor) {
        return sponsorMapper.insertSponsor(sponsor);
    }

    /**
     * 修改赞助
     *
     * @param sponsor 赞助信息
     * @return 结果
     */
    @Override
    public int updateSponsor(Sponsor sponsor) {
        return sponsorMapper.updateSponsor(sponsor);
    }

    @Override
    public int updateSponsorClick(Sponsor sponsor) {
        return sponsorMapper.updateSponsorClick(sponsor);
    }

    /**
     * 删除赞助信息
     *
     * @param sponsorId 赞助ID
     * @return 结果
     */
    @Override
    public int deleteSponsorById(Long sponsorId) {
        return sponsorMapper.deleteSponsorById(sponsorId);
    }

    /**
     * 批量删除赞助信息
     *
     * @param sponsorIds 需要删除的赞助ID
     * @return 结果
     */
    @Override
    public int deleteSponsorByIds(Long[] sponsorIds) {
        return sponsorMapper.deleteSponsorByIds(sponsorIds);
    }
}
